package com.attendance.pojo;

import com.attendance.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 部门
 *
 * @author 鵺丶
 * @date 2021/03/13
 */
@Data
@Component
@EqualsAndHashCode(callSuper = true)
@TableName("t_depart")
public class Department extends BaseEntity {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private Long idx;
    private Long parentId;
    @TableField(exist = false)
    private List<Department> children = new ArrayList<>();
}
